package com.coderman.common.starter.service;

import com.coderman.common.starter.entity.FeeCodeConfigEntity;
import com.coderman.common.starter.nacos.datajson.service.ConfigCallBackService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Description:
 * date: 2020/9/30 4:54 下午
 *
 * @author fanchunshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
@Service
public class ConfigCallBackServiceImpl implements ConfigCallBackService {
    /**
     * 模拟从数据库中读取数据配置
     * @return
     */
    @Override
    public Map<String, List> getAllConfigList() {
        List  list = new ArrayList();
        FeeCodeConfigEntity codeConfigEntity = new FeeCodeConfigEntity();
        codeConfigEntity.setFeeCode("001");
        codeConfigEntity.setFeeName("001Name");
        codeConfigEntity.setId(10000L);
        codeConfigEntity.setStatus(0);

        FeeCodeConfigEntity codeConfigEntity2 = new FeeCodeConfigEntity();
        codeConfigEntity2.setFeeCode("002");
        codeConfigEntity2.setFeeName("002Name");
        codeConfigEntity2.setId(10002L);
        codeConfigEntity2.setStatus(0);

        FeeCodeConfigEntity codeConfigEntity3 = new FeeCodeConfigEntity();
        codeConfigEntity3.setFeeCode("003");
        codeConfigEntity3.setFeeName("003Name");
        codeConfigEntity3.setId(10003L);
        codeConfigEntity3.setStatus(1);

        FeeCodeConfigEntity codeConfigEntity4 = new FeeCodeConfigEntity();
        codeConfigEntity4.setFeeCode("004");
        codeConfigEntity4.setFeeName("003Name");
        codeConfigEntity4.setId(10004L);
        codeConfigEntity4.setStatus(0);

        list.add(codeConfigEntity);
        list.add(codeConfigEntity2);
        list.add(codeConfigEntity3);
        list.add(codeConfigEntity4);
        Map<String, List> listMap = new HashMap<>();
        listMap.put("FeeCodeConfigEntity",list);
        return listMap;
    }
}
